import Layout from '@/layout'
// 常量路由
export const constantRoutes = [
  // 登录路由
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  // 404报错路由
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  // 退出路由
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: {
        title: 'Dashboard',
        icon: 'dashboard'
      }
    }]
  },
  {
    name: 'Product',
    path: '/product',
    // 进入产品分类里的时候  默认跳转到list列表
    redirect: '/product/category/list',
    component: Layout,
    meta: {
      title: '商品管理',
      icon: 'el-icon-s-shop'
    },
    children: [
      // 注册分类管理路由
      {
        name: 'Category',
        path: 'category/list',
        component: () => import('@/views/product/Category'),
        meta: {
          title: '分类管理'
        }
      },
      // 注册品牌管理路由
      {
        name: 'Trademark',
        path: 'trademark/list',
        component: () => import('@/views/product/Trademark'),
        meta: {
          title: '品牌管理'
        }
      },
      // 注册平台属性路由
      {
        name: 'Attr',
        path: 'attr/list',
        component: () => import('@/views/product/Attr'),
        meta: {
          title: '平台属性管理'
        }
      },
      // 注册SPU管理路由
      {
        name: 'Spu',
        path: 'spu/list',
        component: () => import('@/views/product/Spu'),
        meta: {
          title: 'SPU管理'
        }
      },
      // 注册SKU管理路由
      {
        name: 'Sku',
        path: 'sku/list',
        component: () => import('@/views/product/Sku'),
        meta: {
          title: 'SKU管理'
        }
      },

    ]
  },

  // 404路径
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]
